package com.dlxj.action;

import com.dlxj.entity.Receiptpatrol;
import com.dlxj.service.ReceiptPatrolService;
import com.dlxj.util.MyJSON;

public class ReceiptPatrolTaskAction {

	ReceiptPatrolService receiptPatrolService;
	String json;
	String pid;
	String ptid;
	int bid;
	Receiptpatrol receiptpatrol;

	public String receipt() {

		int code = receiptPatrolService.receiptTask(receiptpatrol);
		json = "{code:" + code + "}";
		return "success";
	}

	public String over() {
		int code = receiptPatrolService.overTask(ptid);
		json = "{code:" + code + "}";
		return "success";
	}

	public String findByPidAndPtid() {
		Receiptpatrol receiptpatrol = receiptPatrolService.findByPidAndPtid(
				pid, ptid);
		json = MyJSON.toJson(receiptpatrol, "circuitriesForStartpoleNo",
				"circuitriesForEndpoleNo").toString();
		return "success";

	}

	public String sure() {
		int code = receiptPatrolService.receiptTask(ptid, pid, bid);
		json = "{code:" + code + "}";
		return "success";

	}

	public ReceiptPatrolService getReceiptPatrolService() {
		return receiptPatrolService;
	}

	public void setReceiptPatrolService(
			ReceiptPatrolService receiptPatrolService) {
		this.receiptPatrolService = receiptPatrolService;
	}

	public String getJson() {
		return json;
	}

	public void setJson(String json) {
		this.json = json;
	}

	public Receiptpatrol getReceiptpatrol() {
		return receiptpatrol;
	}

	public void setReceiptpatrol(Receiptpatrol receiptpatrol) {
		this.receiptpatrol = receiptpatrol;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getPtid() {
		return ptid;
	}

	public void setPtid(String ptid) {
		this.ptid = ptid;
	}

	public int getBid() {
		return bid;
	}

	public void setBid(int bid) {
		this.bid = bid;
	}

}
